Efficient Translation of External Input in a Dynamically Typed Language
نویسنده
چکیده
New algorithms are given to compile external data in string form into data structures for high level datatypes. Let I be a language of external constants formed from atomic constants and from set, multiset, and tuple constructors. We show how to read an input string C, decide whether it belongs to I, convert it to internal form, and build initial data structures storing the internal value of C in linear worst case time with respect to the number of symbols in C. The algorithm does not require hashing or address arithmetic, but relies only on list processing. A principal subproblem is to detect and remove duplicate elements from set-valued input. To solve this subproblem we extend the technique of multiset discrimination [2, 5] to detect all duplicate elements of a multiset, where these elements may themselves be tuples, multisets, or sets with arbitrary degree of nesting. To handle the case where the elements are multisets, we introduce a new technique called weak sorting, which sorts all of these multisets uniformly according to an arbitrary total order computed by the algorithm. The cost of computing this total order and of sorting all of the multisets is linear in the sum of the number of elements in each of the multisets. Our algorithms are based on a sequential pointer RAM model of computation [4, 7], which accesses and stores data using pointers but disallows address arithmetic (which precludes direct access into arrays). This improves on previous algorithms used to solve the related reading problem in SETL [3, 6]. Those algorithms used hashing even for deeply nested data to detect duplicate values. If we assume that hashing unit-space data takes unit expected time and linear worst case time, then for arbitrary data their algorithm would require linear expected time and quadratic worst case time in the number of symbols in C.
منابع مشابه
Towards a Speech - to - Speech Translation System ( 1 )
We describe our Universal Parser Architecture and its use in a speech translation system, based on the Machine Translation system under development at the Center for Machine Translation at Carnegie Mellon. To "understand" natural language, a system must have syntactic knowledge of the language and semantic knowledge of the domain. The Universal Parser Architecture allows grammar writers to deve...
متن کاملExternal Factors and Iranian EFL Teachers’ Performance: Examining the Effectiveness of Self- regulation
Purpose: This paper follows a two-fold objective: First it examines the relationship between the external factors of compensation, support, empowerment, boundaries and expectations, pre-service and in- service training and Iranian EFL teachers’ performance. Second, it searches for the moderating effect of self-regulation on the relationship between teachers’ external assets and their performanc...
متن کاملAn Investigation of the Linguistic, Paralinguistic and Sociocultural Effects of Input on the Perception and Translation of Gerunds by Persian Speakers of English
In this study, it was intended to investigate the Persian native speakers’ perception of gerunds by three different elicitation techniques i.e., written, audio, and pictorial through translation. Eighty intermediate learners of English were asked to select Persian translation of the gerund formsin these elicitation techniques. They were asked to choose one option from a pair of written first la...
متن کاملType Inference to Optimize a Hybrid Statically and Dynamically Typed Language
Dynamically typed languages are becoming increasingly popular for different software development scenarios such as Web engineering, rapid prototyping, or the construction of applications that require runtime adaptiveness. In contrast, statically typed languages have undeniable advantages such as early type error detection and more opportunities for compiler optimizations. Since both approaches ...
متن کاملOn the Efficiency and Adequacy of L2 Instruction and Input
The present study was planned to investigate the efficiency of explicit teaching and adequacy of the L2 learners' exposure to L2 input in academic contexts in Iran. The case at hand was the acquisition of referential, quasi and expletive subject pronouns, as three different types of obligatory subjects in English. 96 Iranian EFL learners were selected from two universities in Isfahan. They were...
متن کامل